import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/index'
  },
  {
    path: '/index',
    name: 'Index',
     // 路由懒加载
    component: () => import(/* webpackChunkName: "Index" */ '@/views/Index.vue')
  }, {
    path: '/classify',
    name: 'Classify',
    component: () => import(/* webpackChunkName: "Classify" */ '@/views/Classify.vue')
  }, {
    path: '/login',
    name: 'Login',
    component: () => import(/* webpackChunkName: "Login" */ '@/views/Login.vue')
  }, {
    path: '/my',
    name: 'My',
    component: () => import(/* webpackChunkName: "My" */ '@/views/My.vue')
  }, {
    path: '*',
    name: 'notFound',
    component: () => import('@/views/NotFound')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
